package com.csw.android.ffmpegtest.ui.section5

import android.os.Bundle
import android.view.View
import com.csw.android.ffmpegtest.R
import com.csw.android.ffmpegtest.databinding.LayoutSection501Binding
import com.csw.android.ffmpegtest.gl.SectionRenderer
import com.csw.android.ffmpegtest.ui.base.DataBindingFragment

/**
 * 绘制一个三角形
 */
class Section503 : DataBindingFragment<LayoutSection501Binding>() {
    override fun getContentViewID(): Int {
        return R.layout.layout_section_501
    }

    override fun initView(rootView: View, savedInstanceState: Bundle?) {
        super.initView(rootView, savedInstanceState)
        dataBinding?.glSurfaceView?.run {
            setEGLContextClientVersion(3)
            setRenderer(SectionRenderer(503))
        }
    }

    override fun onResume() {
        super.onResume()
        dataBinding?.glSurfaceView?.onResume()
    }

    override fun onPause() {
        super.onPause()
        dataBinding?.glSurfaceView?.onPause()
    }
}